package com.ruoyi.project.mydy.labelinfo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mydy.labelinfo.mapper.DlLabelInfoMapper;
import com.ruoyi.project.mydy.labelinfo.domain.DlLabelInfo;
import com.ruoyi.project.mydy.labelinfo.service.IDlLabelInfoService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 标签Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-07
 */
@Service
public class DlLabelInfoServiceImpl implements IDlLabelInfoService 
{
    @Autowired
    private DlLabelInfoMapper dlLabelInfoMapper;

    /**
     * 查询标签
     * 
     * @param id 标签主键
     * @return 标签
     */
    @Override
    public DlLabelInfo selectDlLabelInfoById(Long id)
    {
        return dlLabelInfoMapper.selectDlLabelInfoById(id);
    }

    /**
     * 查询标签列表
     * 
     * @param dlLabelInfo 标签
     * @return 标签
     */
    @Override
    public List<DlLabelInfo> selectDlLabelInfoList(DlLabelInfo dlLabelInfo)
    {
        return dlLabelInfoMapper.selectDlLabelInfoList(dlLabelInfo);
    }

    /**
     * 新增标签
     * 
     * @param dlLabelInfo 标签
     * @return 结果
     */
    @Override
    public int insertDlLabelInfo(DlLabelInfo dlLabelInfo)
    {
        dlLabelInfo.setCreateTime(DateUtils.getNowDate());
        return dlLabelInfoMapper.insertDlLabelInfo(dlLabelInfo);
    }

    /**
     * 修改标签
     * 
     * @param dlLabelInfo 标签
     * @return 结果
     */
    @Override
    public int updateDlLabelInfo(DlLabelInfo dlLabelInfo)
    {
        return dlLabelInfoMapper.updateDlLabelInfo(dlLabelInfo);
    }

    /**
     * 批量删除标签
     * 
     * @param ids 需要删除的标签主键
     * @return 结果
     */
    @Override
    public int deleteDlLabelInfoByIds(String ids)
    {
        return dlLabelInfoMapper.deleteDlLabelInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除标签信息
     * 
     * @param id 标签主键
     * @return 结果
     */
    @Override
    public int deleteDlLabelInfoById(Long id)
    {
        return dlLabelInfoMapper.deleteDlLabelInfoById(id);
    }
}
